import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)


// 懒加载导入路由
const index = () => import('views/Index')
const message = () => import('views/Message')
const video = () => import('views/Video')
const profile = () => import('views/Profile')
const searchView = () => import('components/content/SearchView')
const navigation = () => import('components/content/Navigation')
const recommend = () => import('components/content/Recommend')
const darecommend = () => import('components/content/Darecommend')
const podcastView = () => import('components/content/PodcastView')
const songlist = () => import('components/content/Songlist')
const videoView = () => import('components/content/VideoView')
const rankinglist = () => import('components/content/Rankinglist')
const lyricView = () => import('components/common/LyricView.vue')
const songlistinformation = () => import('components/content/Songlistinformation')
const songlistinformationlist = () => import('components/content/Songlistinformationlist')
const mypage = () => import('components/content/Mypage')
const login = () => import('components/content/Login')
const register = () => import('components/content/Register')

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    name: "foo",
    components: {
      views: index
    }
  },
  {
    path: '/message',
    name: "message",
    components: {
      views: message
    }
  },
  {
    path: '/video',
    name: "video",
    components: {
      views: video
    }
  },
  {
    path: '/profile',
    name: "profile",
    components: {
      views: profile
    }
  },
  //搜索页面路由
  {
    path: '/searchView',
    name: 'searchView',
    components: {
      search: searchView
    }
  },
  {
    path: '/navigation',
    name: 'navigation',
    components: {
      search: navigation
    }
  },
  {
    path: '/recommend',
    name: 'recommend',
    components: {
      search: recommend
    }
  },
  {
    path: '/podcastView',
    name: 'podcastView',
    components: {
      video: podcastView
    }
  },
  {
    path: '/videoView',
    name: '/videoView',
    components: {
      video: videoView
    }
  },
  {
    path: '/darecommend',
    name: 'darecommend',
    components: {
      search: darecommend
    }
  },
  {
    path: '/songlist',
    name: 'songlist',
    components: {
      search: songlist
    }
  },
  {
    path: '/rankinglist',
    name: 'rankinglist',
    components: {
      search: rankinglist
    }
  },
  {
    path: '/songlistinformation',
    name: 'songlistinformation',
    components: {
      search: songlistinformation
    }
  },
  {
    path: '/songlistinformationlist',
    name: 'songlistinformationlist',
    components: {
      search: songlistinformationlist
    }
  },
  {
    path: '/mypage',
    name: 'mypage',
    components: {
      search: mypage
    }
  },
  {
    path: '/login',
    name: 'login',
    components: {
      search: login
    }
  },
  ,
  {
    path: '/register',
    name: 'register',
    components: {
      search: register
    }
  },
  // 歌词展示页面
  {
    path: '/lyricView',
    name: 'lyricView',
    components: {
      lyric: lyricView
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
